package com.tau.egonetwork.gui;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

import com.tau.egonetwork.common.Log;

public class Environment {

	private static Display display;
	
	public static Image ICON;
	
	public static Image ICON_OK;
	public static Image ICON_ERROR;
	public static Image ICON_CLOSE;
	
	public static Image ICON_HOURGLASS;
	public static Image ICON_FACEBOOK;
	public static Image ICON_LINKEDIN;

	public static Image ICON_FACEBOOK_PROFILE;
	public static Image ICON_LINKEDIN_PROFILE;
	
	public static Image ICON_NEW;
	public static Image ICON_EDIT;
	public static Image ICON_SAVE;
	public static Image ICON_DELETE;
	public static Image ICON_SEARCH;
	public static Image ICON_PRIORITIZE;
	public static Image ICON_EXCEL;
	public static Image ICON_CLUSTER;
	public static Image ICON_VISUALIZE_1;
	public static Image ICON_VISUALIZE_2;
	
	public static Image BG_MAIN;
	public static Image BG_TITLE;
	public static Image BG_DIALOG_TITLE;
	public static Image BG_TOOLBAR;

	public static Image FACEBOOK_BG;
	public static Image FACEBOOK_LOGO;
	public static Image FACEBOOK_PROFILE;
	public static Image FACEBOOK_OPEN;
	
	public static Image LINKEDIN_BG;
	public static Image LINKEDIN_LOGO;
	public static Image LINKEDIN_PROFILE;
	public static Image LINKEDIN_OPEN;
	
	public static Color COLOR_WHITE;
	public static Color COLOR_RED;
	public static Color COLOR_TABLE_ROW;
	public static Color COLOR_TABLE_BG;
	
	public static int unsavedProfiles;
		
	static {

		Log.writeLineToLog("Loading Environment images and colors...");

		display = MainWindow.getDisplay();
		ICON = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/icon.png"));
		ICON_OK = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/check.png"));
		ICON_ERROR = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/error.png"));
		ICON_CLOSE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/close.png"));
		ICON_HOURGLASS = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/hourglass.png"));
		ICON_FACEBOOK = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/facebookIcon.png"));
		ICON_LINKEDIN = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/linkedinIcon.png"));
		ICON_FACEBOOK_PROFILE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/facebookUserIcon.png"));
		ICON_LINKEDIN_PROFILE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/linkedinUserIcon.png"));
		ICON_NEW = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/new.png"));
		ICON_EDIT = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/edit.png"));
		ICON_SAVE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/save.png"));
		ICON_DELETE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/delete.png"));
		ICON_SEARCH = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/search.png"));
		ICON_PRIORITIZE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/prioritize.png"));
		ICON_EXCEL = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/excel.png"));
		ICON_CLUSTER = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/cluster.png"));
		ICON_VISUALIZE_1 = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/visualize.png"));
		ICON_VISUALIZE_2 = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/visualize2.png"));
		BG_MAIN = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/mainbg.jpg"));
		BG_TITLE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/titlebg.png"));
		BG_DIALOG_TITLE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/titleDialogbg.jpg"));
		BG_TOOLBAR = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/toolbarBackground.png"));
		FACEBOOK_BG = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/facebookbg.jpg"));
		FACEBOOK_LOGO = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/facebookLarge.png"));
		FACEBOOK_PROFILE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/facebookButton.png"));
		FACEBOOK_OPEN = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/facebookOpen.png"));
		LINKEDIN_BG = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/linkedinbg.jpg"));
		LINKEDIN_LOGO = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/linkedinLarge.png"));
		LINKEDIN_PROFILE = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/linkedinButton.png"));
		LINKEDIN_OPEN = new Image(display, Program.class.getResourceAsStream("/com/tau/egonetwork/resources/linkedinOpen.png"));
		COLOR_WHITE = new Color(display, 0xff, 0xff, 0xff);
		COLOR_RED = new Color(display, 0xff, 0x00, 0x00);
		COLOR_TABLE_ROW = new Color(null, 0xf4, 0xf4, 0xf4);
		COLOR_TABLE_BG = new Color(null, 0x6c, 0x6c, 0x6c);
		
		unsavedProfiles = 0;
	}
	
	//make constructor private - cannot instantiate
	private Environment() { }

	public static void enableSaveMenuItem(boolean enabled) {
		MainWindow.setSaveMenuItemEnabled(enabled);
	}
	
}
